package com.ashen.study.service;

import com.ashen.study.aop.CurrentUserHolder;
import org.springframework.stereotype.Component;

/**
 * @author hxl
 * @Classname AuthService
 * @Description
 * @Date 2019/9/6 14:04
 */
@Component
public class AuthService {

    public void checkAccess(){
        String user = CurrentUserHolder.get();
        if (!"洪帅".equals(user)) {
            System.out.println("抛出异常!!");
            throw new RuntimeException("抛出异常！非洪帅不得登录");
        }
    }
}
